<template>
    <div id="container">

    </div>
</template>

<script>
import * as echarts from "echarts"
export default {
  name: "ActionFront",
  mounted(){
    this.initCharts()
  },
  methods: {

    initCharts() {
      const chartDom = document.getElementById('container');
      const myChart3 = echarts.init(chartDom);
      // var app = {};
      let option1;
      option1 = {
        graphic: {
          elements: [
            {
              type: 'text',
              left: 'center',
              top: 'center',
              style: {
                text: '亚运会展示',
                fontSize: 60,
                fontWeight: 'bold',
                lineDash: [0, 200],
                lineDashOffset: 0,
                fill: 'transparent',
                stroke: 'red',
                lineWidth: 1
              },
              keyframeAnimation: {
                duration: 3000,
                loop: false,
                keyframes: [
                  {
                    percent: 0.7,
                    style: {
                      fill: 'transparent',
                      lineDashOffset: 200,
                      lineDash: [200, 0]
                    }
                  },
                  {
                    // Stop for a while.
                    percent: 0.8,
                    style: {
                      fill: 'transparent'
                    }
                  },
                  {
                    percent: 1,
                    style: {
                      fill: 'red'
                    }
                  }
                ]
              }
            }
          ]
        }
      };
      if (option1 && typeof option1 === 'object') {
        myChart3.setOption(option1);
      }
      window.addEventListener("resize",()=>{
        myChart3.resize();
      });
    }
  }
}
</script>

<style scoped>
#container{
  width: 100%;
  height: 100%;
}
</style>
